<template>
	<view class="root">
		<view
			v-if="showTip&&userInfo.parent_info"
			style="display: flex;align-items: center;justify-content: space-between;margin: 0 20rpx;font-size: 24rpx;color: #000000;">
			<text>你现在访问的是 {{userInfo.parent_info.nickname}} 的网上店铺</text>
			<image @click="showTip=false" style="width: 40rpx;height: 40rpx;" src="../../static/icon/close.png" mode=""></image>
		</view>
		<!-- 轮播图 -->
		<view class="" style="width: 100%;position: relative;">
			<view style="position: absolute;top: 10rpx;right: 10rpx;z-index: 10;">
				<view class="square" @tap="navTo('/pages/search/search')"
					style="display: flex;align-items: center;justify-content: center;">
					<text style="color: #DDDDDD;opacity: 0.8;">搜素</text>
					<image style="width: 40rpx;height: 40rpx;margin-left: 5rpx;" src="../../static/icon/search.png"
						mode=""></image>
				</view>
			</view>
			<swiper autoplay circular :interval="5000" :duration="150" style="width: 100%;">
				<block v-for="(items,indexs) in leftTabbar" :key='indexs'>
					<swiper-item v-if="items.advert_pic != ''" @tap.stop="detail(items.advert_url)">
						<view class="swiper-item uni-bg-blue">
							<image :src="items.advert_pic" class="slide-image" style="width: 100%;height: 400rpx;" />
						</view>

					</swiper-item>
				</block>
			</swiper>
		</view>
		<!-- 供应商信息和云仓酒庄说明 -->
		<view class="" style="margin: 20rpx 20rpx;display: flex;border-radius: 8rpx;font-size: 26rpx;background: #fff;">
			<view class=""
				style="flex-grow: 1;display: flex;align-items: center;justify-content: center;border-right: 1px solid #DDDDDD;margin: 30rpx 0;">
				<image style="width: 80rpx;height: 80rpx;margin-right: 5rpx;" src="../../static/icon/icon1.png" mode="">
				</image>
				<view @tap="navTo('/pages/yun/parent')">
					<view class="" style="font-weight: bold;">供货商信息</view>
					<view class="">您的供货商信息</view>
				</view>
			</view>
			<view class="" style="flex-grow: 1;display: flex;align-items: center;justify-content: center;">
				<image style="width: 80rpx;height: 80rpx;margin-right: 5rpx;" src="../../static/icon/icon2.png" mode="">
				</image>
				<view @tap="navTo('/pages/yun/tip')">
					<view class="" style="font-weight: bold;">商城说明</view>
					<view class="">传统业务线上化</view>
				</view>
			</view>
		</view>
		<!-- 分类菜单 -->
		<view class="" style="margin:20rpx;display: flex;justify-content: space-between;">
			<view
				:class="{active2:cateOneId==15}"
				@click="cateSelect(15)"
				style="display: flex;flex-direction: column;align-items: center;justify-content: center;background: #FFFFFF;width: 170rpx;height: 170rpx;border-radius: 20rpx;">
				<image style="width: 100rpx;height: 100rpx;" src="https://yc.tytjk.cn/images/8/2024/01/Dq86JQq56Zqn7QQ8QLQ9Zn65Tq8QQu.png" mode=""></image>
				<text class="aui-item-text">品牌推荐</text>
			</view>
			<!-- <view
			:class="{active2:cateOneId==252}"
				@click="cateSelect(252)"
				style="display: flex;flex-direction: column;align-items: center;justify-content: center;background: #FFFFFF;width: 170rpx;height: 170rpx;border-radius: 20rpx;">
				<image style="width: 100rpx;height: 100rpx;" src="https://yc.tytjk.cn/images/8/2024/01/OQGW7CsTZGSTZrSR7sJSScT0cnwSr0.png" mode=""></image>
				<text class="aui-item-text">生鲜果肉</text>
			</view>
			<view
			:class="{active2:cateOneId==188}"
				@click="cateSelect(188)"
				style="display: flex;flex-direction: column;align-items: center;justify-content: center;background: #FFFFFF;width: 170rpx;height: 170rpx;border-radius: 20rpx;">
				<image style="width: 100rpx;height: 100rpx;" src="https://yc.tytjk.cn/images/8/2024/01/SmF78CHLmKkvlrtQi68hzpQwZX9FMt.png" mode=""></image>
				<text class="aui-item-text">食品饮料</text>
			</view>
			<view
			:class="{active2:cateOneId==284}"
				@click="cateSelect(284)"
				style="display: flex;flex-direction: column;align-items: center;justify-content: center;background: #FFFFFF;width: 170rpx;height: 170rpx;border-radius: 20rpx;">
				<image style="width: 100rpx;height: 100rpx;" src="https://yc.tytjk.cn/images/8/2024/01/LqEcSAovFRiZIIPO4qi6qICSqrR2Fi.png" mode=""></image>
				<text class="aui-item-text">穿戴服饰</text>
			</view> -->
		</view>

		<!-- 商品 -->
		<div class="fui-goodslist" style="height: 785.133px;">
			<div id="vue2" class="container fui-left" style="">
				<div @click="cateTwoSelect(cateTwo)" v-for="(cateTwo,index) in cateTwoList" :key="cateTwo.id" :data-index="index" data-id="cateTwo.id" :class="{active:cat_id==cateTwo.id}" class="fui-list-item">
					<span>
						<i class="point"></i>
					</span> 
					{{cateTwo.name}}
				</div>
			</div>
			<div id="vue4" class="container fui-right" style="overflow: hidden;">
				<div class="bscroll-box"
					style="transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1); transition-property: transform; transition-duration: 0ms; transform: translateX(0px) translateY(0px) translateZ(1px);">
					<div data-index="0" data-id="17" id="seriesitem0" class="seriesitem" style="pointer-events: auto;">
						<div class="fui-list-title"><i class="points"></i><span
								style="margin-left: 0.5rem;">{{cate_name}}</span></div>
						<div class="fui-list-item" v-for="goods in rightTabbar" :key="goods.id" @tap="navToGoods(goods.id)">
							<div class="thumb">
								<img src="https://shop.tytjk.cn/plugin/many_shop/static/images/isrecommends.png"
									alt="" onerror="" class="pic_mark">
								<div class="pic_thumb goodsthumb"
									:style="`background-image: url(&quot;${goods.cover_pic}?x-oss-process=image/resize,p_50&quot;);`"
									data-lazyloaded="true"
									:data-lazy-background="goods.cover_pic+'?x-oss-process=image/resize,p_50'">
								</div> 
								<img
									src="https://yc.tytjk.cn/images/8/2024/01/MLXNY7451IYygXlmt59LY1fx99tXEG.png" alt=""
									onerror="" class="pic_border">
							</div>
							<div class="fui-middle">
								<div class="goodstitle" style="font-size: 0.73rem;">{{goods.name}}</div>
								<!---->
								<div class="vol">
									<span><img
											src="https://yc.tytjk.cn/images/8/2022/01/IKqcxRieZ7pexcIoX6XIHXRcD7cAXr.png"
											alt="" onerror="" style="margin-right: 0.2rem;"></span>
								</div>
								<div class="fui-bottom-price">
									<div class="price"><span style="font-size: 0.6rem;">￥</span>{{goods.price}}
										<span><i data-goodsid="925" data-type="1" class="icon icon-roundaddfill"
												style="color: rgb(225, 49, 70); --darkreader-inline-color: #e44256;"
												data-darkreader-inline-color=""></i>
											<!---->
										</span>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>




		<backTop :src="backTop.src" :scrollTop="backTop.scrollTop"></backTop>



		<!--加载loadding-->
		<!-- 版权 -->
		<!-- <diy-copyright v-if="copyright.status == 1" :value="copyright"></diy-copyright>
		<view class="ap-link" @click="navToLink()"
			style="width: 100%;height: 30rpx;margin-bottom: 30rpx;text-align: center;font-size: 25rpx;">
			粤ICP备19145623号
		</view> -->

		<!-- 版权 -->
		<!-- <view style="height: 100rpx;"></view> -->
		<!-- 导航栏 -->
		<!-- #ifdef H5||MP-WEIXIN   -->
		<main-tabbar v-if='modelSHOw'></main-tabbar>
		<!--#endif -->
		<!-- #ifdef APP-PLUS  -->
		<!-- <main-tabbar></main-tabbar> -->
		<!--#endif -->
		<!-- 导航栏 -->

		<!-- <navigator url="../business-card/client/index">跳转名片</navigator> -->
	</view>
</template>

<script>
	import diyHeader from '@/components/commodity/header.vue';
	import seckillSlider from '@/components/commodity/seckill-slider.vue';
	import search from '@/components/search/search.vue';
	import banners from '@/components/banners/banners';
	import navIcon from '@/components/navIcon/navIcon';
	import rubik from '@/components/rubik/rubik';
	import commodity from '@/components/commodity/commodity';
	import groupBuy from '@/components/groupBuy/groupBuy';
	import thematic from '@/components/thematic/thematic.vue';
	import placeholder from '@/components/placeholder/placeholder.vue';
	import orderPopup from '@/components/order-popup/order-popup.vue';
	import coupon from '@/components/coupon/coupon';
	import tuiScrollTop from '@/components/scroll-top/scroll-top';
	// import pendant from "@/components/pendant/pendant.vue";
	import ceiling from '@/components/ceiling/ceiling.vue';
	import moreGoods from '@/components/moreGoods/moreGoods.vue';
	import tuiFab from '@/components/tui-fab/tui-fab';
	import notice from '@/components/notice/notice.vue';
	import diyImageText from '@/components/diy/diy-image-text.vue';
	import diyCopyright from '@/components/diy/diy-copyright.vue';
	import diyMap from '@/components/diy/diy-map.vue';
	import diyModal from '@/components/diy/diy-modal.vue';
	import vouchers from '@/components/vouchers.vue';
	import citySelect from '@/components/linzq-home/linzq-city.vue';
	import backTop from '@/components/back-top/back-top.vue';
	import diyTimer from '@/components/diy/diy-timer.vue';
	import diyMch from '@/components/diy/diy-mch.vue';
	import websocket from '@/components/websocket/websocket';
	//#ifdef H5 
	var jweixin = require('jweixin-module');
	//#endif
	import {
		isEmpty
	} from '../../common/validate.js';
	export default {
		components: {
			diyTimer,
			diyMch,
			search,
			banners,
			navIcon,
			rubik,
			commodity,
			groupBuy,
			thematic,
			placeholder,
			coupon,
			seckillSlider,
			diyHeader,
			orderPopup,
			tuiScrollTop,
			// pendant,
			ceiling,
			moreGoods,
			tuiFab,
			notice,
			diyImageText,
			diyCopyright,
			diyMap,
			diyModal,
			vouchers,
			backTop,
			citySelect,
			websocket
		},
		data() {
			return {
				img_url: this.$api.img_url,
				plugins_img_url: this.$api.plugins_img_url,
				loading: false,

				top: 0,
				left: 0,
				right: 30,
				bottom: 300,
				bgColor: '#5677fc',
				btnList: [],
				statusHeight: 0, //状态栏高度
				suspendedList: [{
						bgColor: '#16C2C2',
						//图标/图片地址
						imgUrl: '/static/images/fab/fab_about.png',
						//图片高度 rpx
						imgHeight: 64,
						//图片宽度 rpx
						imgWidth: 64,
						//名称
						text: '关于',
						//字体大小
						fontSize: 34,
						//字体颜色
						color: '#fff'
					},
					{
						bgColor: '#64B532',
						imgUrl: '/static/images/fab/fab_share.png',
						imgHeight: 64,
						imgWidth: 64,
						text: '分享',
						fontSize: 34,
						color: '#fff'
					},
					{
						bgColor: '#FFA000',
						imgUrl: '/static/images/fab/fab_reward.png',
						imgHeight: 64,
						imgWidth: 64,
						text: '联系客服',
						fontSize: 34,
						color: '#fff'
					}
				],

				fromTop: 0, //获取元素距离顶部高度
				receiveColor: '', //接收轮播图组件穿过来的背景色
				timer: '', //延时器变量
				oldScrollTop: 0, //记录上一次滚动结束后的滚动距离
				scrollTop: 0, // 记录当前的滚动距离
				searchHeight: 0, //搜索框高度
				// 回到顶部参数
				scrollTop: 0,
				isAllCat: 0,

				//占位符参数
				placeholderHeight: 10,
				placeholderHeight4: 80, //80,

				//吸顶组件参数
				styleBool: true,
				t_page: 1,

				// 搜索参数
				is_fixed: 0, //暂时用来控制搜索框是否固定定位

				// 气泡弹窗
				orderPopupData: [{
						pic_url: '',
						name: '哈哈哈哈',
						time: 3
					},
					{
						pic_url: '',
						name: 'dense1',
						time: 3
					},
					{
						pic_url: '',
						name: 'dense2',
						time: 3
					}
				],

				//团购商品数据
				g_listStyle: 2, //1为大图 2为一行一个 3为一行两个
				g_displayStyle: 1, //1为常规 2为边框 3为居中显示 4为边框居中
				g_productNameBool: true, //商品名，true为显示，false为不显示
				g_priceBool: true, //商品价格，true为显示，false为不显示
				g_buyBtnBool: true, //购物车按钮，true为显示，false为不显示
				g_buyBtnStyle: 3, //购物车按钮样式。3为文字样式1 4为文字样式2 5为文字样式3 6为文字样式4
				g_subscriptBool: true, //角标，true为显示，false为不显示
				g_subscriptStyle: 1, //角标样式。1为热销 2为新品 3为折扣 4为推荐 5为自定义
				g_subscriptIcon: 'http://store.hzstorm.com/web/statics/mch/images/diy/time.png', //角标为自定义的时候才需要传
				//导航栏数据
				tabCurrent: 0,
				selectedColor: '#bc0100',
				// 秒杀商品列表
				seckillGoods: [{
						img: 'http://img12.360buyimg.com/n1/jfs/t1/111874/33/3368/122650/5ea7bfb4Ea097bc8e/04b759fb100461ae.jpg',
						des: '这是第一个描述',
						price: 498,
						curPrice: 298
					},
					{
						img: '//img20.360buyimg.com/mobilecms/s255x255_jfs/t1/116052/20/3382/139411/5ea7bfb2Ea3bf2dda/722cb20b6dff28a2.jpg!cc_255x255.webp',
						des: '这是第二个描述',
						price: 598,
						curPrice: 398
					},
					{
						img: '//img12.360buyimg.com/n1/jfs/t1/115076/4/3420/174848/5ea7bfb1E5f015ad3/73f770f69cea5571.jpg',
						des: '这是第三个描述',
						price: 711,
						curPrice: 311
					},
					{
						img: '//m.360buyimg.com/babel/s333x333_jfs/t1/33728/10/12924/112345/5cf61386E2db7f1f0/81f13416b1522681.jpg!q70.dpg',
						des: '这是第一个描述',
						price: 698,
						curPrice: 398
					},
					{
						img: 'http://m.360buyimg.com/babel/s333x333_jfs/t1/33728/10/12924/112345/5cf61386E2db7f1f0/81f13416b1522681.jpg!q70.dpg',
						des: '这是第二个描述',
						price: 512,
						curPrice: 312
					},
					{
						img: '//img12.360buyimg.com/n1/jfs/t1/115076/4/3420/174848/5ea7bfb1E5f015ad3/73f770f69cea5571.jpg',
						des: '这是第三个描述',
						price: 423,
						curPrice: 223
					}
				],
				copyright: '', //版权数据
				indexData: '',
				serviceLink: '',
				webapp: {
					nickName: "",
					avatarUrl: '',
					province: '',
					city: '',
					pageUrl: '',
					pageTitle: '',
					phone: '',
				},
				modelSHOw: true,
				showFoucs: false,
				page_count: '',
				page: 1,

				goods_ist: [],
				backTop: {
					src: '../../static/back-top/top.png',
					scrollTop: 0
				},
				city: '',
				cityselec: false,
				loadding: false,
				pullUpOn: true,
				loading: false,
				leftTabbar: [],
				currentTab: '',
				cateTwoList:[],
				cateOneId:15,
				cat_id:'',
				rightTabbar:[],
				cate_name:'',
				showTip:true,
				userInfo:{}
			};
		},
		onShow() {
			this.getData('show');
			let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
			let curRoute = routes[routes.length - 1].route //获取当前页面路由   //   webview/webview
			let curParam = routes[routes.length - 1].options; //获取路由参数     //   {"userId":"1000007"}
			if (typeof curParam['pid'] != "undefined" && curParam.pid) {
				uni.setStorageSync('pid', curParam.pid);
				uni.setStorageSync("user_id", curParam.pid);
			}
			if (uni.getStorageSync("shopCity")) {
				uni.removeStorageSync("shopCity")
			}
			if (uni.getStorageSync("current")) {
				uni.removeStorageSync("current")
			}
			//---------------------------------------------------------------首页进来绑定上下级
			//#ifdef MP-WEIXIN||H5
			this.getCartList()
			//#endif
			//--------------------------------------------------------------------------	
			this.$nextTick(function() {
				/*下次 DOM 更新时，找到某个控件*/
				this.$refs.websocket.init();
			});
		},
		onHide() {
			this.$refs.websocket.close();
		},
		onUnload() {
			this.$refs.websocket.close();
		},
		onReachBottom() {
			//上拉加载
			this.t_page++;
			this.page++;
		},
		onLoad(options) {
			this.getLeftData()
			this.getmyLOcation()
			this.beforeOnLoad(options);

			if (options.pid) {
				uni.setStorageSync('pid', options.pid);
				uni.setStorageSync("user_id", options.pid);
			}
			if (uni.getStorageSync('mall_config')) {
				this.copyright = JSON.parse(uni.getStorageSync('mall_config')).copyright;
			}
			this.getData();
			this.btnList = [...this.suspendedList];
			//#ifdef MP-WEIXIN
			this.checkUpdateVersion();
			//#endif
			this.getService()
			if (uni.getStorageSync('userInfo')) {
				let userMessage = JSON.parse(uni.getStorageSync('userInfo'))
				this.userInfo = userMessage
				this.webapp = JSON.stringify({
					nickName: userMessage.nickname,
					avatarUrl: userMessage.avatar,
					province: '',
					city: '',
					pageUrl: 'pages/index/index',
					pageTitle: '',
					phone: userMessage.mobile,
				})
			}
			//#ifdef H5 || APP-PLUS
			this.$wechatSdk.initJssdk(function(signData) {

			});
			//#endif
			/* 
			uni.navigateTo({
				url: '/pages/personalCentre/ercode/payPages/payPages?id=262'
			});
			return; */

			let that = this;
			uni.getSystemInfo({
				success(res) {
					that.top = (res.statusBarHeight / res.screenWidth) * 750;
				}
			});
		},
		methods: {
			navToGoods(id){
				console.log(45454);
				uni.navigateTo({
					url:'/pages/goods/detail?proId='+id
				})
			},
			getRightData(cat_id){//获取右边的数据
				// 默认写死分类，会修改
				cat_id = 820

				this.loading = true;
				this.$http.request({
					url:this.$api.goods.rightList,
					data:{
						cat_id
					},
				}).then((res)=>{
					this.loading = false;
					if(res.code == 0){
						this.rightTabbar = res.data.list;
					}
				})
			},
			cateSelect(cateOneId){
				this.cateOneId = cateOneId
				this.setCate()

			},
			getLeftData() { //获取左边tab数据
				this.loading = true;
				this.$http.request({
					url: this.$api.category.leftlist
				}).then((res) => {
					this.loading = false;
					if (res.code == 0) {
						this.leftTabbar = res.data.list;
						this.setCate()
						
					}
				})
				
			},
			// 选中二级分类
			cateTwoSelect(cateTwo){
				this.cat_id = cateTwo['id']
				this.cate_name = cateTwo['name']
				this.getRightData(this.cat_id)
			},
			setCate(){
				this.leftTabbar.forEach((item, index) => {
					// if (this.id == item.id) {
					// 	this.currentTab = index;
					// }
					if (this.cateOneId == item.id) {
						this.cateTwoList = item.child;
						this.cat_id = item.child.length>0 &&item.child[0]['id']
						this.cate_name = item.child.length>0 &&item.child[0]['name']
						this.getRightData(this.cat_id)
					}
					
				})
			},
			getmyLOcation() {
				let that = this
				//#ifdef H5
				that.$unifylocation.locationH5()
				setTimeout(() => {
					if (uni.getStorageSync('x-longitude-new'), uni.getStorageSync('x-latitude-new')) {
						uni.setStorageSync('x-longitude', uni.getStorageSync('x-longitude-new'))
						uni.setStorageSync('x-latitude', uni.getStorageSync('x-latitude-new'))
					}
				}, 500)
				// #endif

				// #ifndef H5
				that.$unifylocation.locationMp()
				setTimeout(() => {
					if (uni.getStorageSync('x-longitude-new'), uni.getStorageSync('x-latitude-new')) {
						uni.setStorageSync('x-longitude', uni.getStorageSync('x-longitude-new'))
						uni.setStorageSync('x-latitude', uni.getStorageSync('x-latitude-new'))
					}
				}, 500)
				// #endif
			},





			foucusInfo() {
				//window.location.href="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzI3MTIzMjAyOQ==&scene=#wechat_redirect"
				uni.navigateTo({
					url: '/pages/diy/diy?page_id=114'
				});
			},
			getCartList() { //获取购物车列表
				this.$http.request({
					url: this.$api.cart.list,
					method: 'GET'
				}).then((res) => {
					if (res.code == 0) {
						this.modelSHOw = true
						if (res.wechat_subscribe == 1) {
							// this.showFoucs=false
						} else {
							// this.showFoucs=true
						}
					} else {
						// this.modelSHOw=false
						// this.showFoucs=true
					}
				})
			},
			navToLink() {
				window.location.href = 'http://beian.miit.gov.cn'
			},
			getService() {
				this.$http
					.request({
						url: this.$api.moreShop.getservice,
						method: 'POST',
					})
					.then(res => {
						if (res.code == 0) {
							this.serviceLink = res.data
						}
					});
			},
			goService() {
				if (uni.getStorageSync('userInfo')) {
					let userMessage = JSON.parse(uni.getStorageSync('userInfo'))
					this.webapp = JSON.stringify({
						nickName: userMessage.nickname,
						avatarUrl: userMessage.avatar,
						province: '',
						city: '',
						pageUrl: 'pages/index/index',
						pageTitle: '',
						phone: userMessage.mobile,
					})
					console.log(this.webapp)
				}
			},
			linkService() {
				//#ifdef H5
				location.href = this.serviceLink
				//#endif
				// #ifdef APP-PLUS
				plus.runtime.openURL(this.serviceLink); //成功跳转了
				//#endif
			},
			// 判断微信版本是否 兼容小程序更新机制API的使用
			checkUpdateVersion() {
				if (uni.canIUse('getUpdateManager')) {
					const updateManager = wx.getUpdateManager();
					updateManager.onCheckForUpdate(function(res) {
						console.log(res.hasUpdate)
						if (res.hasUpdate) {
							updateManager.onUpdateReady(function() {
								updateManager.applyUpdate();
							})
							updateManager.onUpdateFailed(function() {
								uni.showModal({
									title: '已经有新版本喽~',
									content: '请您删除当前小程序，到微信 “发现-小程序” 页，重新搜索打开哦~',
								})
							})
						}
					})
				} else {
					uni.showModal({
						title: '溫馨提示',
						content: '当前微信版本过低，无法使用该功能，请升级到最新微信版本后重试。'
					})
				}
			},
			ceilingSwitch() {
				//吸顶组件点击事件
				this.t_page = 1;
			},
			getData(key) {
				var that = this;
				this.$http
					.request({
						url: this.$api.index2
					})
					.then(res => {
						if (res.code == 0) {
							if (key) {
								// #ifdef  H5
								this.$wechatSdk.initShareUrl(res.data.share_data, 'source=1');
								// #endif
								return;
							}
							this.indexData = res.data.page_data;
							uni.stopPullDownRefresh();
						}
					});
			},
			setStatusBarHeight() {
				//获取状态栏高度
				var that = this;
				uni.getSystemInfo({
					success(res) {
						that.statusHeight = res.statusBarHeight;
					}
				});
			},
			setSearchHeight() {
				this.searchHeight = 96 / 750 * wx.getSystemInfoSync().windowWidth;
			},
			onClick(e) {
				let index = e.index;
				switch (index) {
					case -1:
						this.tui.toast('您点击了悬浮按钮');
						break;
					case 0:
						uni.navigateTo({
							url: '/pages/about/about'
						});
						break;
					case 1:
						// #ifdef MP || H5
						this.clipboard('https://thorui.cn/');
						// #endif
						//#ifdef APP-PLUS
						plus.share.sendWithSystem({
								content: 'ThorUI组件库',
								href: 'https://thorui.cn/'
							},
							function() {
								console.log('分享成功');
							},
							function(e) {
								console.log('分享失败：' + JSON.stringify(e));
							}
						);
						//#endif
						break;
					case 2:
						uni.makePhoneCall({
							phoneNumber: '13535014139', //需要拨打的电话
							success: res => {
								this.tui.toast('打电话回调成功！');
							}
						});
						break;
					default:
						break;
				}
			},
			getConfigData() {
				this.$http
					.request({
						url: this.$api.index.config
					})
					.then(res => {
						if (res.code === 0) {
							let {
								cat_style,
								copyright,
								mall_setting,
								navbar,
								page_title
							} = res.data;
							this.copyright = copyright;
							uni.setStorageSync('mall_config', JSON.stringify(res.data));
						}
					});
			},
			change(e) {
				if (this.bannerData.style == 1 && this.bannerData.filling == 1) {
					this.receiveColor = e;
				}
			},
			//路由跳转
			navTo(url) {
				uni.navigateTo({
					url:url
				})
			},
			//优惠券路由跳转
			navTo2() {
				uni.navigateTo({
					url: '/pages/coupon/list'
				});
			},
			//优惠券领取
			receiveClick(val) {
				this.couponData;
				if (this.couponData[val.index].receive == 1) {
					this.$http.toast('你已经领取过该优惠券啦！');
				} else {
					this.couponData[val.index].receive = 1;
				}
			},
			setCITY() { //选择城市
				this.cityselec = true
			},
			back_city(e) { //城市选择回显
				if (e !== 'no') {
					this.city = e.name;
					this.cityselec = false;
				} else {
					this.cityselec = false;
					uni.pageScrollTo({
						scrollTop: 0,
						duration: 100
					});
					this.page = 1
					this.goods_ist = []
					this.getmyLOcation()
				}
			},
		},
		onPageScroll(e) {
			this.backTop.scrollTop = e.scrollTop;
			var that = this;
			let info = uni.createSelectorQuery().select('.ceiling-box');
			info.boundingClientRect(function(data) {
				if (data) {
					that.fromTop = data.top; //获取元素距离顶部的距离
				}
			}).exec();

			this.setSearchHeight();
			this.setStatusBarHeight();
			this.scrollTop = e.scrollTop;
			this.searchHeight = this.is_fixed == 1 ? 0 : this.searchHeight;
			if (this.fromTop < this.searchHeight + this.statusHeight) {
				this.styleBool = false;
			} else {
				this.styleBool = true;
			}
		},

	};
</script>

<style lang="less">
	.square {
		width: 150rpx;
		/* 正方形的宽度 */
		height: 80rpx;
		/* 正方形的高度 */
		background-color: rgba(255, 255, 255, 0.5);
		// background-color: #fff; /* 正方形的背景颜色 */
		border-top-right-radius: 40rpx;
		/* 右上角半圆的半径 */
		border-bottom-right-radius: 40rpx;
		/* 右下角半圆的半径 */
		border-top-left-radius: 40rpx;
		/* 左上角全圆半径 */
		border-bottom-left-radius: 40rpx;
		/* 左下角全圆半径 */
		overflow: hidden;
		/* 隐藏超出部分 */
		text-align: center;
		line-height: 80rpx;

	}

	.uni-margin-wrap {
		width: 690rpx;
		width: 100%;
	}

	.swiper {
		height: 300rpx;
	}

	.swiper-item {
		display: block;
		height: 300rpx;
		line-height: 300rpx;
		text-align: center;
	}

	.swiper-list {
		margin-top: 40rpx;
		margin-bottom: 0;
	}

	.uni-common-mt {
		margin-top: 60rpx;
		position: relative;
	}

	.info {
		position: absolute;
		right: 20rpx;
	}

	.uni-padding-wrap {
		width: 550rpx;
		padding: 0 100rpx;
	}

	.root {
		background: #f7f7f7;
	}

	.content {
		/* padding: 0 20rpx; */
	}

	.customer_service {
		width: 100rpx;
		height: 100rpx;
		position: fixed;
		z-index: 999;
		right: 40rpx;
		/* #ifdef H5*/
		bottom: 180rpx;
		/* #endif */
		/* #ifdef APP-PLUS*/
		bottom: 260rpx;
		/* #endif */

		/* #ifdef  MP  */
		bottom: 260rpx;
		/* #endif */
		border-radius: 50%
	}

	.customer_service image {
		width: 100rpx;
		height: 100rpx;
		display: block;
		border-radius: 50%;
	}

	.buttonWeapp {
		width: 100rpx;
		height: 100rpx;
		display: block;
		border-radius: 50%;
		background: url(https://dev.mingyuanriji.cn/web/static//service_logo.png)no-repeat;
		background-size: cover;
	}

	.limited {
		background: #ffffff;
		box-sizing: border-box;
	}

	.status_bar {
		height: 44px;
		width: 100%;
		position: fixed;

		top: 0;
		z-index: 99;
		background-color: #ffffff;

	}

	.search_box {
		width: 100%;
		z-index: 99;
		display: flex;
		background: #fff;
	}

	.navIcon_style {
		/* padding: 30rpx 0px; */
	}

	.adBoxs {
		overflow: hidden;
	}

	.ad1 {
		font-weight: 700;
		text-align: center;
		padding: 20rpx 0px;
	}

	.rubikBox {
		width: 92%;
		margin: auto;
		border-radius: 20rpx;
		overflow: hidden;
	}

	.thematicBox {
		padding: 20rpx 0rpx 20rpx;
		border-radius: 10rpx;
		/* background: #FFFFFF; */
	}

	.bannersBox {
		position: relative;
		margin-top: 10rpx;
	}

	.order {
		position: absolute;
		top: 20px;
		left: 20rpx;
		z-index: 9;
	}

	// 云仓样式
	.fui-goodslist {
		display: flex;
		/* padding: 0.4rem 0 0; */
		overflow: hidden;
		-webkit-transition-duration: 300ms;
		transition-duration: 300ms;
		position: relative;
		/* margin-bottom: 2.6rem; */
		margin-top: .4rem;
	}

	.fui-goodslist .fui-left {
		overflow: auto;
	}

	.fui-goodslist .fui-left .active {
		background-color: #fff;
		color: #000;
		font-weight: bold;
	}

	.fui-goodslist .fui-left .fui-list-item {
		padding: 0.6rem 0.65rem;
		font-size: 0.62rem;
		text-align: right;
		border-top-left-radius: 1rem;
		border-bottom-left-radius: 1rem;
		position: relative;
	}
	.fui-goodslist .fui-right {
	    background-color: #f3f3f3;
	    flex: 1;
	    position: relative;
	}
	.bscroll-box {
	    padding-bottom: 1rem;
	    display: block;
	    // -webkit-overflow-scrolling: touch;
	    // overflow-scrolling: touch;
		overflow-y: scroll;
	}
	.fui-goodslist .fui-right .seriesitem {
	    background: #fff;
	    margin-bottom: 5rem;
	    border-radius: 0 0.4rem 0.4rem 0.4rem;
	}
	.fui-list-title {
	    padding: 0.5rem 0.5rem 0;
	    font-size: .62rem;
	    position: relative;
	}
	.fui-goodslist .fui-right .fui-list-item {
	    padding: 0.5rem;
	    margin-top: 0.3rem;
	    width: 14rem;
	    display: flex;
	    font-size: 0.6rem;
	    position: relative;
	    align-items: center;
	}
	.points {
	    display: inline-block;
	    background: #E13146;
	    width: 0.1rem;
	    height: 45%;
	    position: absolute;
	    top: 45%;
	}
	.fui-goodslist .fui-right .fui-list-item .thumb {
	    margin-right: 0.3rem;
	    position: relative;
	}
	.fui-list-item .pic_mark {
	    position: absolute;
	    right: 0;
	    top: 0;
	    width: 1.55rem;
	    /* height: 0.8rem; */
	}
	.pic_border {
	    position: absolute;
	    top: 0;
	    left: 0;
	    width: 100%;
	    height: 100%;
	}
	.fui-goodslist .fui-right .fui-list-item .thumb .pic_thumb {
	    width: 4.2rem;
	    height: 4.2rem;
	}
	#vue4 .fui-list-item .pic_thumb.goodsthumb {
	    background-image: url("https://yc.tytjk.cn/images/8/2022/07/ILCh3mmIBGzCM0i01nLdd02zEGZcLH.jpg");
	    background-size: 100%;
	}
	.goodstitle {
	    font-size: 0.65rem;
	    display: -webkit-box;
	    overflow: hidden;
	    text-overflow: ellipsis;
	    -webkit-box-orient: vertical;
	    -webkit-line-clamp: 2;
	    font-weight: bold;
	}
	.fui-goodslist .fui-right .fui-list-item .price {
	    color: #ff5555;
	    font-size: .85rem;
	}
	.active2 {
    	border: 1px solid #D5283D;
	}
	.active2 .aui-item-text {
		color: #D5283D !important;
	}
	.active .point {
    display: inline-block;
    background: #E13146;
    border-radius: 50%;
    width: 0.3rem;
    height: 0.3rem;
    margin-bottom: 0.1rem;
	margin-right: 0.1rem;
}
</style>
